def canWin(n):
    return True if n%4 != 0 else False

def dp(n):
    if 0 < n <= 3:
        return True
    elif n == 4: 
        return False
    else:
        return dp(n-1) or dp(n-2) or dp(n-3)
    
n = 40
print(canWin(n) == dp(n))
print(canWin(n))
print(dp(n))